/**
 * 文档参考:https://www.quanzhan.co/luch-request
 * github:https://github.com/lei-mu/luch-request
 * 类似axios的api
 */
import Request from "luch-request";

/**
 * 请求实例
 */
const http = new Request({
	baseURL: 'http://192.168.18.251:7001',
	// baseURL: 'http://39.107.46.215:81'
});

/**
 * 请求拦截
 */
http.interceptors.request.use(
	async config => {
			console.log('请求地址为：' + config.url)
			return config;
		},
		config => {
			return Promise.reject(config);
		}
);

/**
 * 响应拦截
 */
http.interceptors.response.use(
	async response => {
			return response.data;
		},
		response => {
			return Promise.reject(response);
		}
);

export default http;
